#!/usr/bin/env python3

from quick2wire.spi import *
import time

mcp23s17 = SPIDevice(0, 0)

while(True):
  try:
    response = mcp23s17.transaction(writing_bytes(0x41, 0x13), reading(1))
    print ("output = %i" % ord(response[0]))
    time.sleep(1)
  except KeyboardInterrupt:
        break



